package com.xm2.demo.login.admin.dao;

import com.xm2.demo.model.Position;
import com.xm2.demo.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * @Create
 * @create 2018-12-20 17:41
 * @Description：
 */
@Repository
public interface AdminRepository extends JpaRepository<User,Integer> {

    User findUserByPhone(@Param("phone") String phone);

    @Query(value = "from Position p where p.positionId = :pid")
    Position getPositionByPid(@Param("pid") Integer pid);
}
